<?php

namespace app\system\model;

use think\Model;

class SysConfigModel extends Model
{
    protected $table = "sys_config";
    protected $pk = "config_name";

    protected $field = [
        "config_name",          // 配置名
        "config_value"          // 配置值 
    ];

    // 取配置值
    public function getConfigValue($configName)
    {
        $configValue = $this->where(["config_name" => $configName])->value("config_value");
        return $configValue;
    }

    // 设置配置值
    public function setConfigValue($config)
    {
        // dump($config);die;
        $obj = $this->saveAll($config);
        return $obj;
    }
}
